<template>
    <div id="wrap">

      <home-header :city="city"></home-header>
      <home-swiper :imgUrl="swiperList"></home-swiper>
      <home-icons :iconsUrl="iconList"></home-icons>
      <home-other :weekUrl="weekUrl" :guessList="guessList"></home-other>
      <home-week :week="week"></home-week>
      <home-footer></home-footer>
    </div>

</template>

<script>
  import HomeHeader from '@/pages/home/components/header'
  import HomeSwiper from '@/pages/home/components/swiper'
  import HomeIcons from '@/pages/home/components/icons'
  import HomeOther from '@/pages/home/components/other'
  import HomeWeek  from '@/pages/home/components/week'
  import HomeFooter from '@/pages/home/components/footer'
  import axios from 'axios'
    export default {
        name: "Home",
      data(){
          return{
            city:"",
            swiperList:[],
            iconList:[],
            weekUrl:[],
            guessList:[],
            week:[]


          }
      },
      methods:{
          getHomeInfo(){
            axios.get('static/moke/index.json').then(this.getSucc)
          },
          getSucc(res){
            // console.log(res.data);
            var res=res.data;
            if(res.ret && res.data){
              this.city=res.data.city;
              this.swiperList=res.data.imgUrl;
              this.iconList=res.data.iconsUrl;
              this.weekUrl=res.data.weekUrl;
              this.guessList=res.data.guessList;
              this.week=res.data.week

            }

          }
      },
      mounted(){
          this.getHomeInfo();
      },
      components:{
          HomeHeader,
          HomeSwiper,
          HomeIcons,
          HomeOther,
          HomeWeek,
          HomeFooter
      }
    }
</script>

<style lang="stylus" scoped>
  #wrap{

  }
</style>
